From 0496f983a21720b7f59ee7243316b1e2e4cdf5b8 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Wed, 2 Aug 2006 10:04:27 +0100 Subject: [PATCH] [HVM] Fix an issue with APIC priority checks. Signed-off-by; Yunhong Jiang --- xen/arch/x86/hvm/vlapic.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c index 900a98e485..1257d592be 100644 --- a/xen/arch/x86/hvm/vlapic.c +++ b/xen/arch/x86/hvm/vlapic.c @@ -210,7 +210,7 @@ static int vlapic_accept_irq(struct vcpu *v, int delivery_mode, if ( unlikely(vlapic == NULL || !vlapic_enabled(vlapic)) ) break; - if ( test_and_set_bit(vector, &vlapic->irr[0]) ) + if ( test_and_set_bit(vector, &vlapic->irr[0]) && level) { HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "level trig mode repeatedly for vector %d\n", vector); @@ -922,7 +922,8 @@ int cpu_get_apic_interrupt(struct vcpu *v, int *mode) { int highest_irr = vlapic_find_highest_irr(vlapic); - if ( highest_irr != -1 && highest_irr >= vlapic->processor_priority ) + if ( highest_irr != -1 && + ( (highest_irr & 0xF0) > vlapic->processor_priority ) ) { if ( highest_irr < 0x10 ) { @@ -952,7 +953,8 @@ int cpu_has_apic_interrupt(struct vcpu* v) if (vlapic && vlapic_enabled(vlapic)) { int highest_irr = vlapic_find_highest_irr(vlapic); - if (highest_irr != -1 && highest_irr >= vlapic->processor_priority) { + if ( highest_irr != -1 && + ( (highest_irr & 0xF0) > vlapic->processor_priority ) ) { return 1; } } -- 2.30.2